﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System.Collections.Generic;
using Microsoft.WVB.Framework;
using Microsoft.WVB.Framework.DataServicesEntities;
using Microsoft.WVB.Framework.Interfaces;
using Microsoft.WVB.Silverlight.Infrastructure;

namespace Microsoft.WVB.UI
{
    public class CarouselModel : BaseController
    {
        private IEnumerable<Broadcaster> _broadcasters;
        public IEnumerable<Broadcaster> Broadcasters
        {
            get
            {
                return _broadcasters;
            }
            set
            {
                _broadcasters = value;
                OnPropertyChanged("Broadcasters");
            }
        }

        public CarouselModel() : base()
        {

            IBroadcasterProvider td = IoC.GetCreate<IBroadcasterProvider>();
            Broadcasters = td.CreateBroadcasterAndChannelList();

            //DataFeedService fs = IoC.GetCreate<DataFeedService>();
            //fs.ExecuteQueryCompleted += new EventHandler<ExecuteQueryCompletedEventArgs>(fs_ExecuteQueryCompleted);
            //fs.ExecuteQueryAsync<Broadcaster>("Broadcasters", null);
        
        }
        void fs_ExecuteQueryCompleted(object sender, ExecuteQueryCompletedEventArgs e)
        {
            //this.Broadcasters = e.Result as IEnumerable<Broadcaster>;
        }


        //public void TellWorldIChangedSomeThing()
        //{
        //    if (DateTime.Now.Second % 2 == 0)
        //        Mediator.NotifyColleagues(MessageTopics.ChangeMedia, new EventArgsT<string>("bears.vmw"));
        //    else
        //        Mediator.NotifyColleagues(MessageTopics.ChangeMedia, new EventArgsT<string>("birds.vmw"));
        //}
    }
}
